package com.yunxin.core.application.dto.order;


import cn.hutool.core.util.NumberUtil;
import lombok.Data;
import org.jetbrains.annotations.NotNull;

import java.util.Date;

@Data
public class PidAndTimeDTO implements  Comparable<PidAndTimeDTO> {


    private Long productId;


    private Date updateTime;

    private Integer seq;


    @Override
    public int compareTo(@NotNull PidAndTimeDTO o) {
        long otime = o.getUpdateTime().getTime();
        long time = this.updateTime.getTime();

        return NumberUtil.compare(otime, time);
    }
}
